home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / complib / sprod1du.z / sprod1du
Encoding:
Text File  |  1998-10-30  |  7.0 KB  |  133 lines

  1.  
  2.  
  3.  
  4. sssspppprrrroooodddd1111dddduuuu,,,,ddddpppprrrroooodddd1111dddduuuu((((3333FFFF))))                                    sssspppprrrroooodddd1111dddduuuu,,,,ddddpppprrrroooodddd1111dddduuuu((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      sssspppprrrroooodddd1111dddduuuu,,,, ddddpppprrrroooodddd1111dddduuuu ---- Compute the product of a 1D Fourier transform with a
  10.      1D filter.
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSYYYYSSSS
  13.      _F_o_r_t_r_a_n :
  14.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee sssspppprrrroooodddd1111dddduuuu(((( nnnn,,,, aaaarrrrrrrraaaayyyy,,,, iiiinnnnccccaaaa,,,, ffffiiiilllltttteeeerrrr,,,, iiiinnnnccccffff))))
  15.           iiiinnnntttteeeeggggeeeerrrr   nnnn,,,, pppp,,,, iiiinnnnccccaaaa,,,, iiiinnnnccccffff
  16.           rrrreeeeaaaallll      aaaarrrrrrrraaaayyyy((((0000::::((((nnnn----1111))))****iiiinnnnccccaaaa)))),,,, ffffiiiilllltttteeeerrrr((((0000::::((((nnnn----1111))))****iiiinnnnccccffff))))
  17.  
  18.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ddddpppprrrroooodddd1111dddduuuu(((( nnnn,,,, aaaarrrrrrrraaaayyyy,,,, iiiinnnnccccaaaa,,,, ffffiiiilllltttteeeerrrr,,,, iiiinnnnccccffff))))
  19.           iiiinnnntttteeeeggggeeeerrrr   nnnn,,,, pppp,,,, iiiinnnnccccaaaa,,,, llllddddaaaa,,,, iiiinnnnccccffff,,,, llllddddffff
  20.           rrrreeeeaaaallll****8888    aaaarrrrrrrraaaayyyy((((0000::::((((nnnn----1111))))****iiiinnnnccccaaaa)))),,,, ffffiiiilllltttteeeerrrr((((0000::::((((nnnn----1111))))****iiiinnnnccccffff))))
  21.  
  22.  
  23.      _C :
  24.      ####iiiinnnncccclllluuuuddddeeee <<<<fffffffftttt....hhhh>>>>
  25.      iiiinnnntttt sssspppprrrroooodddd1111dddduuuu((((iiiinnnntttt nnnn,,,, ffffllllooooaaaatttt ****aaaarrrrrrrraaaayyyy,,,, iiiinnnntttt iiiinnnnccccaaaa,,,,
  26.                ffffllllooooaaaatttt ****ffffiiiilllltttteeeerrrr,,,, iiiinnnntttt iiiinnnnccccffff))));;;;
  27.      iiiinnnntttt ddddpppprrrroooodddd1111dddduuuu((((iiiinnnntttt nnnn,,,, ddddoooouuuubbbblllleeee ****aaaarrrrrrrraaaayyyy,,,,iiiinnnntttt iiiinnnnccccaaaa,,,,
  28.                ddddoooouuuubbbblllleeee ****ffffiiiilllltttteeeerrrr,,,, iiiinnnntttt iiiinnnnccccffff))));;;;
  29.  
  30.  
  31. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  32.      sssspppprrrroooodddd1111dddduuuu and ddddpppprrrroooodddd1111dddduuuu compute the product of the Fourier transforms of a
  33.      real sequence of N samples with the Fourier transforms of a real filter.
  34.      Note, the product of the Fourier transforms of two sequences is equal to
  35.      the Fourier transform of their convolution.
  36.  
  37.  
  38. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  39.      NNNN Integer, the number of samples in each sequence.
  40.      Unchanged on exit.  AAAARRRRRRRRAAAAYYYY Array containing the Fourier Transform.  On
  41.      exit, the array is overwritten by the product.
  42.  
  43.      IIIINNNNCCCCAAAA Integer, increment between two consecutive elements of the sequence.
  44.      Unchanged on exit.
  45.  
  46.      FFFFIIIILLLLTTTTEEEERRRR Array containing the Fourier Transform of the filter(s).
  47.      Unchanged on exit.
  48.  
  49.      IIIINNNNCCCCFFFF Integer, increment between two consecutive elements of the filter.
  50.      Unchanged on exit.
  51.  
  52.  
  53. EEEExxxxaaaammmmpppplllleeee ooooffff CCCCaaaalllllllliiiinnnngggg SSSSeeeeqqqquuuueeeennnncccceeee
  54.      Working on a sequences of 1024 real values.  We successively apply a
  55.      Direct Fourier Transform, the product with a filter transform, then an
  56.      Inverse Fourier Transform-
  57.      Elements of each sequence are stored with increment (stride)1.
  58.      _F_o_r_t_r_a_n
  59.           real array(0:1026-1), filter(0:1026-1), coeff(1024+15)
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. sssspppprrrroooodddd1111dddduuuu,,,,ddddpppprrrroooodddd1111dddduuuu((((3333FFFF))))                                    sssspppprrrroooodddd1111dddduuuu,,,,ddddpppprrrroooodddd1111dddduuuu((((3333FFFF))))
  71.  
  72.  
  73.  
  74.          call scfft1dui( 1024, coeff)
  75.           call scfft1du( -1, 1024, array, 1, coeff)
  76.           ccccaaaallllllll sssspppprrrroooodddd1111dddduuuu(((( 1111000022224444,,,, aaaarrrrrrrraaaayyyy,,,, 1111,,,, ffffiiiilllltttteeeerrrr,,,,
  77.           call csfft1du(  1, 1024, array, 1, coeff)
  78.  
  79.      _C
  80.           #include <fft.h>
  81.           float array[1026], filter[1026], *coeff;
  82.           coeff = scfft1dui( 1024, NULL);
  83.           scfft1du( -1, 1024, array, 1, coeff);
  84.           sssspppprrrroooodddd1111dddduuuu(((( 1111000022224444,,,, aaaarrrrrrrraaaayyyy,,,, 1111,,,, ffffiiiilllltttteeeerrrr,,,, 1111))));;;;
  85.           csfft1du( -1, 1024, array, 1, coeff);
  86.  
  87.      NNNNOOOOTTTTEEEE____1111 :::: Using a 0 leading dimension for the filter is equivalent to
  88.      applying the same filter to all the input sequences.
  89.  
  90.      NNNNOOOOTTTTEEEE____2222 :::: As the FFTs are not normalized, a successive direct, then
  91.      inverse transform, scales the original input by the size of the sequence.
  92.      Rather than calling sscal1d or dscal1d to scale back the result, this
  93.      scaling factor could be directly applied to the filter transform, thus
  94.      saving some extra work.
  95.  
  96. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  97.      fft, scfft1dui, dzfft1dui, scfft1du, dzfft1du, sprod1du, dprod1du,
  98.      sscal1d, dscal1d
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.